<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>星诊所下载</title>
    <style>
        body,
        h1,
        h2,
        h3,
        h4,
        h5,
        h6,
        hr,
        p,
        blockquote,
        dl,
        dt,
        dd,
        ul,
        ol,
        li,
        pre,
        figcaption,
        figure,
        fieldset,
        legend,
        button,
        input,
        textarea,
        th,
        td {
            margin: 0;
            padding: 0
        }

        body,
        button,
        input,
        select,
        textarea {
            font: 12px/1 Lucida Grande, 'Microsoft YaHei', "Lucida Grande", "Lucida Sans Unicode", Helvetica, Arial, Verdana, sans-serif
        }

        input::-webkit-input-placeholder {
            color: #bfbfbf;
        }

        h4,
        h5,
        h6 {
            font-size: 100%;
            font-weight: normal
        }

        address,
        cite,
        dfn,
        em,
        var {
            font-style: normal
        }

        code,
        kbd,
        pre,
        samp,
        tt {
            font-family: "Courier New", Courier, monospace
        }

        small {
            font-size: 12px
        }

        ul,
        ol,
        li {
            list-style: none;
        }

        a {
            text-decoration: none;
        }

        abbr[title],
        acronym[title] {
            border-bottom: 1px dotted;
            cursor: help
        }

        q:before,
        q:after {
            content: ''
        }

        legend {
            color: #000
        }

        fieldset,
        img {
            border: 0
        }

        table {
            border-collapse: collapse;
            border-spacing: 0
        }

        hr {
            border: 0;
            height: 1px
        }

        * {
            -ms-word-break: break-all;
            word-break: break-all;
            -ms-word-wrap: break-word;
            word-wrap: break-word;
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
            box-sizing: border-box;
        }

        html {
            font-size: 625%;
        }

        .view {
            background: #f4f3f3;
            height: 100vh;
        }

        .view .banner {
            width: 100%;
        }

        .view .banner img {
            width: 100%;
            display: block;
        }

        .view .form {
            padding-top: 0.45rem;
            padding-bottom: 0.4rem;
            background-color: white;
            text-align: center;
        }

        .view .form p {
            color: #333333;
            font-size: 0.15rem;
            font-family: PingFang-SC-Light;
            margin-top: 0.1rem;
        }

        .view .form img {
            width: 1.35rem;
        }

        .view .form input {
            margin: 0 auto;
            display: block;
            padding: 0.1rem;
            font-size: 0.14rem;
            width: 2.57rem;
            height: 0.45rem;
            border-radius: 46px;
            border: solid 1px #4c9fff;
            outline: none;
            text-align: center;
        }

        .view .form button {
            width: 1.8rem;
            display: block;
            margin: 0.25rem auto;
            width: 2rem;
            height: 0.45rem;
            outline: none;
            border: none;
            background-image: linear-gradient(-90deg, #117ffc 0%, #0fddd2 100%), linear-gradient(#117ffc, #117ffc);
            background-blend-mode: normal, normal;
            border-radius: 46px;
            font-size: 0.15rem;
            font-weight: normal;
            font-stretch: normal;
            letter-spacing: 0.9px;
            color: #fefefe;
        }

        .ruler {
            background: #f4f3f3;
        }

        .ruler h4 {
            padding-top: 0.24rem;
            font-size: 0.18rem;
            text-align: center;
            font-weight: normal;
            color: #333333;
        }

        .ruler .first {
            margin-top: 0.4rem;
            background-image: linear-gradient(-90deg, #117ffc 0%, #0fddd2 100%), linear-gradient(#117ffc, #117ffc);
            background-blend-mode: normal, normal;
        }

        .ruler .second {
            margin-top: 0.2rem;
            border: solid 1px #117ffc;
            color: #117ffc;
            background: none;
        }

        .ruler button {
            width: 60%;
            margin: 0 auto;
            display: block;
            height: 0.45rem;
            border: none;
            font-size: 0.15rem;
            color: white;
            border-radius: 46px;
        }

        .mask {
            width: 100vw;
            height: 100vh;
            background: black;
            position: fixed;
            left: 0px;
            top: 0px;
            opacity: 0.7;
        }

        .tips {
            position: fixed;
            right: 0px;
            top: 0px;
            width: 70%;
        }
    </style>
</head>

<body>
    <div class="view" id="app">
        <div class="banner">
            <img v-if="isDoctor" src="./img/banner2.png" alt="">
            <img v-else src="./img/banner_other.png" alt="">
        </div>
        <div class="form">
            <img src="./img/logo.png" alt="">
            <p v-if="isDoctor">您身边的智能营销管家</p>
            <p v-else>上星诊所，找好诊所</p>
        </div>
        <div class="ruler">
            <div class="cc">
                <h4 v-if="isDoctor">星诊所医生端app下载</h4>
                <h4 v-else>星诊所app下载</h4>
                <button class="first" @click="appleDown">App下载</button>
            </div>
        </div>
        <div class="mask" @click="showTips = false" v-if="showTips"></div>
        <img class="tips" v-if="showTips" src="./img/wechat_tips.png" alt="">
    </div>
    <script src="https://cdn.bootcss.com/vue/2.5.16/vue.min.js"></script>
    <script>
        let gbs = {
            appleDoctorDownUrl: "http://a.app.qq.com/o/simple.jsp?pkgname=com.ahs.doctorapp&fromcase=40003",
            applePatientDownUrl: "http://a.app.qq.com/o/simple.jsp?pkgname=com.anheshoupati&fromcase=40003"
        }

        new Vue({
            el: '#app',
            data() {
                return {
                    isWechat: false,
                    showTips: false,
                    isDoctor: false
                };
            },

            methods: {
                androidDown: function () {
                    if (this.isWechat) {
                        this.showTips = true
                    } else {
                        if (this.isDoctor) {
                            window.location.href = ""
                        } else {
                        }
                    }
                },
                appleDown: function () {
                    if (this.isDoctor) {
                        window.location.href = gbs.appleDoctorDownUrl
                    } else {
                        window.location.href = gbs.applePatientDownUrl
                    }
                },
                toDownApp: function () { },
                setTitle: function () {
                    document.title = this.isDoctor ? "星诊所医生端app下载" : "星诊所app下载"
                },
                getRequest: function () {
                    var url = location.search; //获取url中"?"符后的字串
                    var theRequest = new Object();
                    if (url.indexOf("?") != -1) {
                        var str = url.substr(1);
                        strs = str.split("&");
                        for (var i = 0; i < strs.length; i++) {
                            theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
                        }
                    }
                    return theRequest;
                },
                isWeChat: function () {
                    var ua = window
                        .navigator
                        .userAgent
                        .toLowerCase()
                    if (ua.match(/MicroMessenger/i) == 'micromessenger') {
                        return true
                    } else {
                        return false
                    }
                }
            },
            mounted: function () {
                this.isWechat = this.isWeChat()
                this.isDoctor = this.getRequest().type == "doctor" ? true : false
            }
        })
    </script>
</body>

</html>